﻿using NHibernate.Validator.Engine;
using TestBat.IModels.Domain;

namespace TestBat.Models.Validators
{
    public class ScheduleDateRangeValidator : IValidator
    {
        public bool IsValid(object value, IConstraintValidatorContext constraintValidatorContext)
        {
            ISchedule s = (ISchedule)value;

            if (s == null)
                return false;

            if (s.Start > s.End)
                return false;
            return true;
        }
    }
}
